package com.c8a.validation.annotation;

import com.c8a.validation.utils.valid.AnnValidCollection;
import com.c8a.validation.utils.valid.AnnValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.groups.Default;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @Author C8A
 * @Date 2022-04-24 18:07
 * @Email 1912327276@qq.com
 */

@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = AnnValidCollection.class)
public @interface ValidCollection {
    /**
     * 要验证的分组
     */

    //HV000073: Parameters starting with 'valid' are not allowed in a constraint.
    //不允许使用以“valid”开头的属性参数
    //Class<?>[] validGroups() default {Default.class};

    Class<?>[] grouping() default {Default.class};

    boolean quickFail() default false;

    String message() default "";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
